<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心 - ShoppingEase</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#FF7D00',
                        success: '#00B42A',
                        warning: '#FF7D00',
                        danger: '#F53F3F',
                        dark: '#1D2129',
                        'dark-2': '#4E5969',
                        'light-1': '#F2F3F5',
                        'light-2': '#E5E6EB',
                        'light-3': '#C9CDD4'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
</head>
<body class="font-inter bg-gray-50 text-dark">
    <!-- 顶部通知栏 -->
    <div class="bg-primary text-white text-center py-1 px-4 text-sm">
        <p>全场满199元免运费 | 新用户注册立减50元 <a href="register.html" class="underline font-medium">立即注册</a></p>
    </div>

    <!-- 导航栏 -->
    <header class="sticky top-0 z-50 bg-white shadow-sm">
        <div class="container mx-auto px-4">
            <div class="flex items-center justify-between h-16 md:h-20">
                <!-- Logo -->
                <a href="index.html" class="flex items-center space-x-2">
                    <i class="fa fa-shopping-bag text-primary text-2xl"></i>
                    <span class="text-xl font-bold text-primary">ShoppingEase</span>
                </a>

                <!-- 搜索栏 - 中等屏幕以上显示 -->
                <div class="hidden md:flex items-center flex-1 max-w-xl mx-8">
                    <div class="relative w-full">
                        <input type="text" placeholder="搜索商品、品牌或分类..." 
                            class="w-full py-2 pl-10 pr-4 rounded-full border border-light-2 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                        <button class="absolute left-3 top-1/2 transform -translate-y-1/2 text-light-3 hover:text-primary transition-colors">
                            <i class="fa fa-search"></i>
                        </button>
                        <button class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-primary text-white py-1 px-4 rounded-full hover:bg-primary/90 transition-colors">
                            搜索
                        </button>
                    </div>
                </div>

                <!-- 用户操作区 -->
                <div class="flex items-center space-x-4">
                    <!-- 搜索按钮 - 小屏幕显示 -->
                    <button class="md:hidden text-dark-2 hover:text-primary transition-colors">
                        <i class="fa fa-search text-xl"></i>
                    </button>
                    
                    <!-- 购物车 -->
                    <a href="cart.html" class="relative text-dark-2 hover:text-primary transition-colors">
                        <i class="fa fa-shopping-cart text-xl"></i>
                        <span id="cart-count" class="absolute -top-2 -right-2 bg-secondary text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">2</span>
                    </a>
                    
                    <!-- 用户菜单 -->
                    <div id="user-menu-container" class="relative">
                        <!-- 未登录状态 -->
                        <div id="guest-menu" class="flex items-center space-x-2">
                            <a href="login.html" class="text-dark-2 hover:text-primary transition-colors">
                                <i class="fa fa-user-circle-o text-xl"></i>
                            </a>
                            <div class="hidden md:block">
                                <a href="login.html" class="text-dark-2 hover:text-primary transition-colors">登录</a>
                                <span class="text-light-3 mx-1">/</span>
                                <a href="register.html" class="text-dark-2 hover:text-primary transition-colors">注册</a>
                            </div>
                        </div>
                        
                        <!-- 已登录状态 -->
                        <div id="user-menu" class="hidden">
                            <button id="profile-btn" class="flex items-center space-x-2 text-dark-2 hover:text-primary transition-colors">
                                <i class="fa fa-user-circle text-xl"></i>
                                <span id="username-display" class="hidden md:inline">用户名</span>
                                <i class="fa fa-angle-down text-xs"></i>
                            </button>
                            <div id="profile-dropdown" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg py-2 z-50">
                                <a href="profile.html" class="block px-4 py-2 text-sm text-dark-2 hover:bg-light-1 hover:text-primary transition-colors">
                                    <i class="fa fa-user-o mr-2"></i>个人中心
                                </a>
                                <a href="#" class="block px-4 py-2 text-sm text-dark-2 hover:bg-light-1 hover:text-primary transition-colors">
                                    <i class="fa fa-history mr-2"></i>我的订单
                                </a>
                                <a href="#" class="block px-4 py-2 text-sm text-dark-2 hover:bg-light-1 hover:text-primary transition-colors">
                                    <i class="fa fa-heart-o mr-2"></i>我的收藏
                                </a>
                                <div class="border-t border-light-2 my-1"></div>
                                <a href="#" id="logout-btn" class="block px-4 py-2 text-sm text-danger hover:bg-light-1 transition-colors">
                                    <i class="fa fa-sign-out mr-2"></i>退出登录
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 移动端搜索框 - 默认隐藏 -->
            <div class="py-3 hidden">
                <div class="relative w-full">
                    <input type="text" placeholder="搜索商品、品牌或分类..." 
                        class="w-full py-2 pl-10 pr-4 rounded-full border border-light-2 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                    <button class="absolute left-3 top-1/2 transform -translate-y-1/2 text-light-3 hover:text-primary transition-colors">
                        <i class="fa fa-search"></i>
                    </button>
                    <button class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-primary text-white py-1 px-4 rounded-full hover:bg-primary/90 transition-colors">
                        搜索
                    </button>
                </div>
            </div>
        </div>
    </header>

    <main class="py-8">
        <div class="container mx-auto px-4">
            <!-- 面包屑导航 -->
            <nav class="flex mb-6 text-sm">
                <a href="index.html" class="text-dark-2 hover:text-primary">首页</a>
                <span class="mx-2 text-light-3">/</span>
                <span class="text-dark">个人中心</span>
            </nav>

            <div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
                <!-- 侧边栏 -->
                <div class="lg:col-span-1 space-y-6">
                    <!-- 用户信息 -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex items-center mb-4">
                            <img src="https://picsum.photos/seed/user1/100/100" alt="用户头像" class="w-16 h-16 rounded-full object-cover">
                            <div class="ml-4">
                                <h3 class="font-bold text-lg">廖**</h3>
                                <p class="text-dark-2 text-sm">普通会员</p>
                            </div>
                        </div>
                        
                        <div class="grid grid-cols-3 text-center border-t border-light-2 pt-4">
                            <div>
                                <p class="font-bold">24</p>
                                <p class="text-dark-2 text-sm">我的订单</p>
                            </div>
                            <div>
                                <p class="font-bold">12</p>
                                <p class="text-dark-2 text-sm">我的收藏</p>
                            </div>
                            <div>
                                <p class="font-bold">5</p>
                                <p class="text-dark-2 text-sm">优惠券</p>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 菜单 -->
                    <div class="bg-white rounded-lg shadow-sm">
                        <ul>
                            <li>
                                <a href="profile.html" class="flex items-center px-6 py-4 text-primary border-l-4 border-primary bg-primary/5">
                                    <i class="fa fa-user-o w-6"></i>
                                    <span>个人信息</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-4 text-dark-2 hover:text-primary hover:bg-primary/5 transition-colors">
                                    <i class="fa fa-history w-6"></i>
                                    <span>我的订单</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-4 text-dark-2 hover:text-primary hover:bg-primary/5 transition-colors">
                                    <i class="fa fa-heart-o w-6"></i>
                                    <span>我的收藏</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-4 text-dark-2 hover:text-primary hover:bg-primary/5 transition-colors">
                                    <i class="fa fa-ticket w-6"></i>
                                    <span>我的优惠券</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-4 text-dark-2 hover:text-primary hover:bg-primary/5 transition-colors">
                                    <i class="fa fa-map-marker w-6"></i>
                                    <span>收货地址</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-4 text-dark-2 hover:text-primary hover:bg-primary/5 transition-colors">
                                    <i class="fa fa-credit-card w-6"></i>
                                    <span>支付方式</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-4 text-dark-2 hover:text-primary hover:bg-primary/5 transition-colors">
                                    <i class="fa fa-bell-o w-6"></i>
                                    <span>消息通知</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-4 text-dark-2 hover:text-primary hover:bg-primary/5 transition-colors">
                                    <i class="fa fa-cog w-6"></i>
                                    <span>账户设置</span>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                
                <!-- 内容区 -->
                <div class="lg:col-span-3 space-y-6">
                    <!-- 个人信息卡片 -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <h2 class="text-lg font-bold mb-6">个人信息</h2>
                        
                        <form class="space-y-6">
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                <div>
                                    <label for="username" class="block text-sm font-medium text-dark-2 mb-1">用户名</label>
                                    <input type="text" id="username" value="廖**" class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                </div>
                                
                                <div>
                                    <label for="phone" class="block text-sm font-medium text-dark-2 mb-1">手机号码</label>
                                    <input type="tel" id="phone" value="138****8000" class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                </div>
                                
                                <div>
                                    <label for="email" class="block text-sm font-medium text-dark-2 mb-1">电子邮箱</label>
                                    <input type="email" id="email" value="liao@example.com" class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                </div>
                                
                                <div>
                                    <label for="gender" class="block text-sm font-medium text-dark-2 mb-1">性别</label>
                                    <select id="gender" class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                        <option value="male">男</option>
                                        <option value="female">女</option>
                                        <option value="other">保密</option>
                                    </select>
                                </div>
                                
                                <div>
                                    <label for="birthday" class="block text-sm font-medium text-dark-2 mb-1">出生日期</label>
                                    <input type="date" id="birthday" value="2004-03-24" class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                </div>
                                
                                <div>
                                    <label for="province" class="block text-sm font-medium text-dark-2 mb-1">所在地区</label>
                                    <div class="grid grid-cols-3 gap-2">
                                        <select class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                            <option>北京市</option>
                                            <option>上海市</option>
                                            <option>广东省</option>
                                        </select>
                                        <select class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                            <option>北京市</option>
                                            <option>广州市</option>
                                            <option>深圳市</option>
                                        </select>
                                        <select class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">
                                            <option>朝阳区</option>
                                            <option>海淀区</option>
                                            <option>福田区</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <label for="signature" class="block text-sm font-medium text-dark-2 mb-1">个性签名</label>
                                <textarea id="signature" rows="3" class="w-full px-3 py-2 border border-light-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all">热爱生活，享受购物带来的乐趣！</textarea>
                            </div>
                            
                            <div class="flex justify-end space-x-3 pt-4">
                                <button type="button" class="px-6 py-2 bg-white text-dark-2 border border-light-2 rounded-lg font-medium hover:bg-light-1 transition-colors">
                                    取消
                                </button>
                                <button type="submit" class="px-6 py-2 bg-primary text-white rounded-lg font-medium hover:bg-primary/90 transition-colors">
                                    保存修改
                                </button>
                            </div>
                        </form>
                    </div>
                    
                    <!-- 最近订单 -->
                    <div class="bg-white rounded-lg shadow-sm p-6">
                        <div class="flex justify-between items-center mb-6">
                            <h2 class="text-lg font-bold">最近订单</h2>
                            <a href="#" class="text-primary hover:underline">查看全部订单</a>
                        </div>
                        
                        <!-- 订单列表 -->
                        <div class="space-y-4">
                            <!-- 订单1 -->
                            <div class="border border-light-2 rounded-lg overflow-hidden">
                                <div class="bg-light-1 px-4 py-3 flex justify-between">
                                    <span class="text-dark-2">订单编号: SE202506080001</span>
                                    <span class="text-dark-2">2025-06-08 10:23:45</span>
                                </div>
                                
                                <div class="p-4">
                                    <div class="flex items-center mb-4">
                                        <img src="images/profile/1.jpg" alt="商品图片" class="w-20 h-20 object-cover rounded-lg">
                                        <div class="ml-4 flex-1">
                                            <h3 class="font-medium">高级无线蓝牙耳机</h3>
                                            <p class="text-sm text-dark-2 mt-1">颜色: 黑色 | 型号: Pro</p>
                                            <div class="flex justify-between items-center mt-2">
                                                <span class="font-medium">¥899.00</span>
                                                <span class="text-dark-2">x1</span>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="flex justify-between items-center border-t border-light-2 pt-4">
                                        <div>
                                            <p class="text-dark-2">订单状态</p>
                                            <p class="font-medium text-success">已完成</p>
                                        </div>
                                        
                                        <div class="flex space-x-2">
                                            <button class="px-4 py-1 bg-white text-primary border border-primary rounded-lg text-sm hover:bg-primary/5 transition-colors">
                                                查看详情
                                            </button>
                                            <button class="px-4 py-1 bg-white text-dark-2 border border-light-2 rounded-lg text-sm hover:bg-light-1 transition-colors">
                                                评价商品
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- 订单2 -->
                            <div class="border border-light-2 rounded-lg overflow-hidden">
                                <div class="bg-light-1 px-4 py-3 flex justify-between">
                                    <span class="text-dark-2">订单编号: SE202506050002</span>
                                    <span class="text-dark-2">2025-06-05 15:45:12</span>
                                </div>
                                
                                <div class="p-4">
                                    <div class="flex items-center mb-4">
                                        <img src="images/profile/2.jpg" alt="商品图片" class="w-20 h-20 object-cover rounded-lg">
                                        <div class="ml-4 flex-1">
                                            <h3 class="font-medium">智能手表</h3>
                                            <p class="text-sm text-dark-2 mt-1">颜色: 银色 | 尺寸: 42mm</p>
                                            <div class="flex justify-between items-center mt-2">
                                                <span class="font-medium">¥1299.00</span>
                                                <span class="text-dark-2">x1</span>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="flex justify-between items-center border-t border-light-2 pt-4">
                                        <div>
                                            <p class="text-dark-2">订单状态</p>
                                            <p class="font-medium text-warning">配送中</p>
                                        </div>
                                        
                                        <div class="flex space-x-2">
                                            <button class="px-4 py-1 bg-white text-primary border border-primary rounded-lg text-sm hover:bg-primary/5 transition-colors">
                                                查看详情
                                            </button>
                                            <button class="px-4 py-1 bg-white text-primary border border-primary rounded-lg text-sm hover:bg-primary/5 transition-colors">
                                                查看物流
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-dark text-white py-12 mt-12">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-lg font-bold mb-4">关于我们</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">公司简介</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">加入我们</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">联系方式</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">隐私政策</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">帮助中心</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">购物指南</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">订单查询</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">售后服务</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">支付方式</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">在线支付</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">银行转账</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">货到付款</a></li>
                        <li><a href="#" class="text-light-3 hover:text-white transition-colors">优惠券说明</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">联系我们</h3>
                    <ul class="space-y-3">
                        <li class="flex items-start">
                            <i class="fa fa-map-marker mt-1 mr-3 text-primary"></i>
                            <span class="text-light-3">广鸡</span>
                        </li>
                        <li class="flex items-center">
                                                <i class="fa fa-phone mr-3 text-primary"></i>
                    <span class="text-light-3">400-123-4567</span>
                </li>
                <li class="flex items-center">
                    <i class="fa fa-envelope mr-3 text-primary"></i>
                    <span class="text-light-3">service@shoppingease.com</span>
                </li>
            </ul>
            
            <div class="mt-4">
                <h4 class="font-medium mb-2">关注我们</h4>
                <div class="flex space-x-3">
                    <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center hover:bg-primary transition-colors">
                        <i class="fa fa-weixin"></i>
                    </a>
                    <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center hover:bg-primary transition-colors">
                        <i class="fa fa-weibo"></i>
                    </a>
                    <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center hover:bg-primary transition-colors">
                        <i class="fa fa-instagram"></i>
                    </a>
                    <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center hover:bg-primary transition-colors">
                        <i class="fa fa-twitter"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>
    
    <div class="border-t border-white/10 mt-8 pt-8 text-center text-light-3 text-sm">
        <p>© 2025 ShoppingEase. 保留所有权利。</p>
    </div>
</footer>

<script src="js/main.js"></script>
<script src="js/auth.js"></script>
<script src="js/cart.js"></script>    